home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / lib / partman / init.d / 50biosgrub < prev    next >
Text File  |  2009-10-28  |  686b  |  35 lines

  1. #! /bin/sh
  2.  
  3. # Set method "biosgrub" for all partitions that have the bios_grub flag set.
  4.  
  5. . /lib/partman/lib/base.sh
  6.  
  7. for dev in $DEVICES/*; do
  8.     [ -d "$dev" ] || continue
  9.     cd "$dev"
  10.     partitions=
  11.     open_dialog PARTITIONS
  12.     while { read_line num id size type fs path name; [ "$id" ]; }; do
  13.         if [ "$fs" != free ]; then
  14.             partitions="$partitions $id"
  15.         fi
  16.     done
  17.     close_dialog
  18.  
  19.     for id in $partitions; do
  20.         biosgrub=no
  21.         open_dialog GET_FLAGS $id
  22.         while { read_line flag; [ "$flag" ]; }; do
  23.             if [ "$flag" = bios_grub ]; then
  24.                 biosgrub=yes
  25.                 # cannot break here
  26.             fi
  27.         done
  28.         close_dialog
  29.         if [ "$biosgrub" = yes ]; then
  30.             mkdir -p $id
  31.             echo biosgrub >$id/method
  32.         fi
  33.     done
  34. done
  35.